package com.mysterymall.Controller;

import com.mysterymall.Common.Comp.Log;
import com.mysterymall.Common.Utils.Result;
import com.mysterymall.Service.SlideshowService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

/**
 * @ClassName com.mysterymall.Controller
 * @Description
 * @Author HuangWX
 * @Time 2023/11/21  09:19
 */
@RestController
@RequestMapping("/slideshow")
public class SlideshowCont {

    private final SlideshowService slideshowService;

    /**
     * 构造器注入
     * @param slideshowService 轮播图服务
     */
    public SlideshowCont(SlideshowService slideshowService) {
        this.slideshowService = slideshowService;
    }

    /**
     * 获取轮播图
     * @return Result
     */
    @GetMapping("/getShowSlideshow")
    @Log
    public Result getShowSlideshow(HttpServletRequest request){
        return slideshowService.getShowSlideshow(request);
    }
}
